

class OuterClass{

    //普通成员变量/实例成员变量
    public int date1 = 0;
    public int date2 = 20;

    public int date4 = 50;
    //实例内部类
    class InnerClass{

        public int date3 = 30;
        public int date4 = 55;
        public InnerClass()
        {
            System.out.println("这时内部类的构造方法");
        }
        public void mothod(){
            System.out.println(date1);
            System.out.println(date2);
            System.out.println(date3);
            System.out.println(date4);
            System.out.println(">>>>"+OuterClass.this.date4);
        }
    }
    public OuterClass(){
        System.out.println("这是外部类的构造方法");
    }
    public void mothod(){
        System.out.println(this.date4);
        InnerClass inner = new InnerClass();
        System.out.println(inner.date4);
    }

}

public class TextDemo {
    public static void main(String[] args) {
        OuterClass outerClass = new OuterClass();
        OuterClass.InnerClass inner = outerClass.new InnerClass();

        outerClass.mothod();

    }
}
